package Utils;

import java.util.Date;

import com.example.idfsgm.util.NotEnoughParticipantsException;

import datatypes.GuardDuty;
import datatypes.Service;
import datatypes.Soldier;
import datatypes.Team;

public class Tester {

	 public static void execTest(){
		 
		 Team team = new Team();
		 Soldier s1 = new Soldier("1","");
		 Soldier s2 = new Soldier("2","");
		 Soldier s3 = new Soldier("3","");
		 Soldier s4 = new Soldier("4","");
		 Soldier s5 = new Soldier("5","");
		 Soldier s6 = new Soldier("6","");
		 
		 s1.setdPoints(10);
		 s2.setdPoints(3);
		 s3.setdPoints(22);
		 s4.setdPoints(15);
		 s5.setdPoints(60);
		 s6.setdPoints(2);
		 
		 team.addSoldier(s1);
		 team.addSoldier(s2);
		 team.addSoldier(s3);
		 team.addSoldier(s4);
		 team.addSoldier(s5);
		 team.addSoldier(s6);
		 
		
		 Date d1 = new Date();
		 Date d2 = new Date();
		 
		 GuardDuty g1 = new GuardDuty(d1,d2);  // 60  => s1
		 GuardDuty g2 = new GuardDuty(d1,d2); // 110 => s2
		 GuardDuty g3 = new GuardDuty(d1,d2); // 370 => s6
		 GuardDuty g4 = new GuardDuty(d1,d2); // 50  => s3
		 
		 Service service = new Service();
		 service.addDuty(g1);
		 service.addDuty(g4);
		 service.addDuty(g3);
		 service.addDuty(g2);
		 service.setNumOfParticipants(4);
		 
		 try {
			ServiceManager.assignDuties(team.getSoldiers(), service);
		} catch (NotEnoughParticipantsException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		 
	 }
}
